home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / unistd.h < prev   
Encoding:
C/C++ Source or Header  |  1995-08-28  |  3.3 KB  |  139 lines

  1. #ifndef _UNISTD_H
  2. #define _UNISTD_H
  3.  
  4. /* see Posix standard -- 1003.1 sect 2.10 */
  5.  
  6. #ifndef F_OK
  7. /* file access stuff: amode */
  8. #define    F_OK            0
  9. #define    X_OK            1
  10. #define    W_OK            2
  11. #define    R_OK            4
  12. #endif
  13.  
  14. #ifndef SEEK_SET
  15. /* lseek() : origin */
  16. #define    SEEK_SET    0        /* from beginning of file */
  17. #define    SEEK_CUR    1        /* from current location */
  18. #define    SEEK_END    2        /* from end of file */
  19. #endif
  20.  
  21.  
  22. /* 1003.1 section 8.2.1.2 */
  23. #define STDIN_FILENO    0
  24. #define STDOUT_FILENO    1
  25. #define STDERR_FILENO    2
  26.  
  27.  
  28.  
  29. extern    void _exit(int status);    /* don't use it but:     */
  30. extern    void exit(int status);
  31.  
  32. extern int    access(const char *name, int amode);
  33. extern int    chdir(const char *pathname);
  34. extern int    close(int handle);
  35. extern int    dup(int handle);
  36. extern int    dup2(int handle1, int handle2);
  37.  
  38. extern char    *getcwd(char *buffer, int size);
  39.  
  40. /* not a standard function */
  41. extern void    cwd(char *buffer);
  42.  
  43. /* not a standard function */
  44. int getopt(int argc, char **argv, char *optstring);
  45.  
  46. extern int    isatty(int handle);
  47. extern long    lseek(int handle, long offset, int origin);
  48.  
  49. #if 0
  50. /* not a standard function */
  51. extern char *mktemp(char *pattern);
  52. #endif
  53.  
  54. extern int    rmdir(const char *pathname);
  55. extern int    read(int handle, void *data, unsigned length);
  56.  
  57. /* not a standard function */
  58. extern long    lread(int handle, void *data, long length);
  59.  
  60. /* not a standard function */
  61. extern unsigned sleep(unsigned int seconds);
  62.  
  63. /* not a standard function */
  64. extern int    stime(long *rawtime);
  65.  
  66. /* not a standard function */
  67. extern long    tell(int handle);
  68.  
  69. extern int unlink(char *filename);
  70.  
  71. extern int    write(int handle, const void *data, unsigned length);
  72.  
  73. /* not a standard function */
  74. extern long    lwrite(int handle, const void *data, long length);
  75.  
  76.  
  77. /* not a standard function */
  78. extern void    usleep (unsigned long usec);
  79.  
  80. extern    int    getpid(void);
  81. extern    int    getppid();
  82.  
  83.     /* defines for not implemeted functions    */
  84. #ifdef __MSHORT__
  85. #define    getuid()    gemdos(0x10f)
  86. #define    geteuid()    gemdos(0x138)
  87. #define    getgid()    gemdos(0x114)
  88. #define    getegid()    gemdos(0x139)
  89.  
  90. #define    kill(pid,sig)    (short)gemdos(0x111, (short)(pid), (short)sig)
  91. #define    nice(delta)    (short)gemdos(0x10a, (short)(delta))
  92. #define    pause()        (short)gemdos(0x121)
  93. #define    alarm(sec)    gemdos(0x120, (long)sec)
  94. #else
  95. #include <osbind.h>
  96. #define    getuid        Pgetuid
  97. #define    geteuid        Pgeteuid
  98. #define    getgid        Pgetgid
  99. #define    getegid        Pgetegid
  100.  
  101. #define    kill(pid,sig)    Pkill((pid),(sig))
  102. #define    nice(delta)    Pnice(delta)
  103. #define    pause()        Pause()
  104. #define    alarm(sec)    Talarm(sec)
  105. #endif /* __MSHORT__ */
  106.  
  107. /* spawn:
  108.  * run a child process executing a command <program>
  109.  * same arguments as for standard exec functions
  110.  */
  111.  
  112. int spawnl(char *program, char *arg0, ...);
  113. int spawnv(char *program, char **argv);
  114. int spawnlp(char *program, char *arg0, ...);
  115. int spawnvp(char *program, char **argv);
  116. int spawnle(char *program, char *arg0, ...);
  117. int spawnlpe(char *program, char *arg0, ...);
  118. int spawnve(char *program, char **argv, char **envp);
  119. int spawnvpe(char *program, char **argv, char **envp);
  120.  
  121.     /* provided for compatibility with older versions, 
  122.      * although the names have changed!!
  123.      */
  124. int spawnvep(char *program, **argv, *envp);
  125. int spawnvpep(char *program, **argv, *envp);
  126.  
  127. /* not a standard function */
  128. char *_conv_unixmode(char *buffer, char *path);
  129.  
  130. #if 0
  131.  
  132.     /* non existent    */
  133. int wait(int *rvp);
  134. int fork(void);
  135.  
  136. #endif
  137.  
  138. #endif /* _UNISTD_H */
  139.